var mongoose = require('mongoose');
//连接数据库
mongoose.connect('mongodb://localhost/test', {useNewUrlParser: true});
var Schema = mongoose.Schema;

var tickSchma = new Schema({
    ticket_typeid:{
        type:String,
        required:true
    },
    ticket_typename:{
        type:String,
        required: true
    },
    typename:{
        type:String,
        required:true
    },
    auth:{
        type:String,
        required:true
    },
    price:{
        type:Number,
        required:true
    },
    amount:{
        type:Number,
        required:true
    },
    url:{
        type:String,
        required:true
    },
    created_time:{
        type:Date,
        default:Date.now
    },
    last_modified_time:{
        type:Date,
        default:Date.now
    },
});

module.exports = mongoose.model('Ticktype', tickSchma);